package ru.spbu.mm.diploma.server.dao;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *
 */
public class DAOBean {
    private final static String CONFIG_FILE_NAME = "spring-config.xml";

    private final static String USER_DAO_NAME = "userDAO";
    private final static String PHASE_DAO_NAME = "phaseDAO";
    private final static String USERROLE_DAO_NAME = "userroleDAO";
    private final static String PROJECT_DAO_NAME = "projectDAO";
    private final static String AUTH_PROJECT_DAO_NAME = "authProjectDAO";
    private final static String RISK_DAO_NAME = "riskDAO";
    private final static String RISK_GROUP_DAO_NAME="riskGroupDAO";

    private final static ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(CONFIG_FILE_NAME);

    public final static IUserDAO userDAO = (IUserDAO) context.getBean(USER_DAO_NAME);
    public final static IUserroleDAO userroleDAO = (IUserroleDAO) context.getBean(USERROLE_DAO_NAME);
    public final static IPhaseDAO phaseDAO = (IPhaseDAO) context.getBean(PHASE_DAO_NAME);
    public final static IProjectDAO projectDAO = (IProjectDAO) context.getBean(PROJECT_DAO_NAME);
    public final static IAuthProjectDAO authProjectDAO = (IAuthProjectDAO) context.getBean(AUTH_PROJECT_DAO_NAME);
    public final static IRiskDAO riskDAO = (IRiskDAO) context.getBean(RISK_DAO_NAME);
    public final static IRiskGroupDAO riskGroupDAO = (IRiskGroupDAO) context.getBean(RISK_GROUP_DAO_NAME);


}
